package com.breakfast.fun.data.entity.mall;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by yukai on 16/10/5.
 */

public class MallOrder {

    /**
     * total : 0
     * pageTotal : 0
     * data : {"id":2113,"orderTime":"2016-10-05 16:10:09","orderNo":"GF201610051610095407","totalPrice":10,"payPrice":10,"freePrice":0,"payFree":0,"quantity":1,"refundState":0,"state":0,"consignee":"zzhyzy","userMobile":"18359928629","detail":"6","remark":"","activityName":"","goods":[{"id":2349,"orderId":2113,"orderNo":"GF201610051610095407","productId":91,"productPrice":10,"productCount":1,"productName":"冰箱收纳盒整理箱日式水饺盒厨房塑料密封保鲜食物鸡蛋储物箱水果1个","free":0,"categoryId":0,"productImage":"http://m.52letsgo.cn/product_image/4/13/c2627d62-5_485199752.jpg","totalPrice":10}]}
     * msg : 查询成功
     * success : true
     */

    private int total;
    private int pageTotal;
    /**
     * id : 2113
     * orderTime : 2016-10-05 16:10:09
     * orderNo : GF201610051610095407
     * totalPrice : 10.0
     * payPrice : 10.0
     * freePrice : 0.0
     * payFree : 0.0
     * quantity : 1
     * refundState : 0
     * state : 0
     * consignee : zzhyzy
     * userMobile : 18359928629
     * detail : 6
     * remark :
     * activityName :
     * goods : [{"id":2349,"orderId":2113,"orderNo":"GF201610051610095407","productId":91,"productPrice":10,"productCount":1,"productName":"冰箱收纳盒整理箱日式水饺盒厨房塑料密封保鲜食物鸡蛋储物箱水果1个","free":0,"categoryId":0,"productImage":"http://m.52letsgo.cn/product_image/4/13/c2627d62-5_485199752.jpg","totalPrice":10}]
     */

    private List<DataBean> data;
    private String msg;
    private boolean success;

    public static MallOrder objectFromData(String str) {

        return new Gson().fromJson(str, MallOrder.class);
    }

    public static List<MallOrder> arrayMallOrderFromData(String str) {

        Type listType = new TypeToken<ArrayList<MallOrder>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public static class DataBean {
        private int id;
        private String orderTime;
        private String orderNo;
        private double totalPrice;
        private double payPrice;
        private double freePrice;
        private double payFree;
        private int quantity;
        private int refundState;
        private int state;
        private String consignee;
        private String userMobile;
        private String detail;
        private String remark;
        private String activityName;
        /**
         * id : 2349
         * orderId : 2113
         * orderNo : GF201610051610095407
         * productId : 91
         * productPrice : 10.0
         * productCount : 1
         * productName : 冰箱收纳盒整理箱日式水饺盒厨房塑料密封保鲜食物鸡蛋储物箱水果1个
         * free : 0.0
         * categoryId : 0
         * productImage : http://m.52letsgo.cn/product_image/4/13/c2627d62-5_485199752.jpg
         * totalPrice : 10.0
         */

        private List<GoodsBean> goods;

        public static DataBean objectFromData(String str) {

            return new Gson().fromJson(str, DataBean.class);
        }

        public static List<DataBean> arrayDataBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<DataBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getOrderTime() {
            return orderTime;
        }

        public void setOrderTime(String orderTime) {
            this.orderTime = orderTime;
        }

        public String getOrderNo() {
            return orderNo;
        }

        public void setOrderNo(String orderNo) {
            this.orderNo = orderNo;
        }

        public double getTotalPrice() {
            return totalPrice;
        }

        public void setTotalPrice(double totalPrice) {
            this.totalPrice = totalPrice;
        }

        public double getPayPrice() {
            return payPrice;
        }

        public void setPayPrice(double payPrice) {
            this.payPrice = payPrice;
        }

        public double getFreePrice() {
            return freePrice;
        }

        public void setFreePrice(double freePrice) {
            this.freePrice = freePrice;
        }

        public double getPayFree() {
            return payFree;
        }

        public void setPayFree(double payFree) {
            this.payFree = payFree;
        }

        public int getQuantity() {
            return quantity;
        }

        public void setQuantity(int quantity) {
            this.quantity = quantity;
        }

        public int getRefundState() {
            return refundState;
        }

        public void setRefundState(int refundState) {
            this.refundState = refundState;
        }

        public int getState() {
            return state;
        }

        public void setState(int state) {
            this.state = state;
        }

        public String getConsignee() {
            return consignee;
        }

        public void setConsignee(String consignee) {
            this.consignee = consignee;
        }

        public String getUserMobile() {
            return userMobile;
        }

        public void setUserMobile(String userMobile) {
            this.userMobile = userMobile;
        }

        public String getDetail() {
            return detail;
        }

        public void setDetail(String detail) {
            this.detail = detail;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public String getActivityName() {
            return activityName;
        }

        public void setActivityName(String activityName) {
            this.activityName = activityName;
        }

        public List<GoodsBean> getGoods() {
            return goods;
        }

        public void setGoods(List<GoodsBean> goods) {
            this.goods = goods;
        }

        public static class GoodsBean {
            private int id;
            private int orderId;
            private String orderNo;
            private int productId;
            private double productPrice;
            private int productCount;
            private String productName;
            private double free;
            private int categoryId;
            private String productImage;
            private double totalPrice;

            public static GoodsBean objectFromData(String str) {

                return new Gson().fromJson(str, GoodsBean.class);
            }

            public static List<GoodsBean> arrayGoodsBeanFromData(String str) {

                Type listType = new TypeToken<ArrayList<GoodsBean>>() {
                }.getType();

                return new Gson().fromJson(str, listType);
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public int getOrderId() {
                return orderId;
            }

            public void setOrderId(int orderId) {
                this.orderId = orderId;
            }

            public String getOrderNo() {
                return orderNo;
            }

            public void setOrderNo(String orderNo) {
                this.orderNo = orderNo;
            }

            public int getProductId() {
                return productId;
            }

            public void setProductId(int productId) {
                this.productId = productId;
            }

            public double getProductPrice() {
                return productPrice;
            }

            public void setProductPrice(double productPrice) {
                this.productPrice = productPrice;
            }

            public int getProductCount() {
                return productCount;
            }

            public void setProductCount(int productCount) {
                this.productCount = productCount;
            }

            public String getProductName() {
                return productName;
            }

            public void setProductName(String productName) {
                this.productName = productName;
            }

            public double getFree() {
                return free;
            }

            public void setFree(double free) {
                this.free = free;
            }

            public int getCategoryId() {
                return categoryId;
            }

            public void setCategoryId(int categoryId) {
                this.categoryId = categoryId;
            }

            public String getProductImage() {
                return productImage;
            }

            public void setProductImage(String productImage) {
                this.productImage = productImage;
            }

            public double getTotalPrice() {
                return totalPrice;
            }

            public void setTotalPrice(double totalPrice) {
                this.totalPrice = totalPrice;
            }
        }
    }
}
